package com.geotmt.billingcenter.modules.consume.service.impl;

import com.geotmt.billingcenter.common.entry.ConsumeRuleHisEntry;
import com.geotmt.billingcenter.modules.consume.mapper.ConsumeRuleHisMapper;
import com.geotmt.billingcenter.modules.consume.service.ConsumeRuleHisService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @Description 类描述
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/3/13 15:17
 * @Version     v1
 **/
@Service
@Transactional(rollbackFor = Exception.class)
public class ConsumeRuleHisServiceImpl implements ConsumeRuleHisService {

    private static final Logger logger = LoggerFactory.getLogger(ConsumeRuleHisServiceImpl.class);

    @Resource
    private ConsumeRuleHisMapper consumeRuleHisMapper;

    @Override
    public Integer addRuleHis(ConsumeRuleHisEntry obj) {
        logger.info("历史消耗 consume add：Service");
        consumeRuleHisMapper.addRuleHis(obj);
        return obj.getId();
    }
}
